const HOST = window.location.host;
const HOST_IP = window.location.hostname;

//科博提供，客户那里可以访问172.16.11.200这个IP进行访问网站，然后我们在172.16.11.200那里做个代理，指向10.200.1.3
var BACKGROUNG_URL;
var FRONT_URL;
if (HOST.indexOf("10.200.1.3") != -1) {
    BACKGROUNG_URL = "http://10.200.1.2:8080/enterprise";
    FRONT_URL = "http://10.200.1.3";
} else if (HOST.indexOf("localhost") != -1 || HOST_IP.indexOf("127.0.0.1") != -1) {
    BACKGROUNG_URL = "http://10.200.1.2:8080/enterprise";
    FRONT_URL = "http://10.200.1.3";
} else {
    BACKGROUNG_URL = "http://" + HOST + "/back_ground_request";
    FRONT_URL = "http://" + HOST;
}

//开发环境 使用localhost或者127.0.0.1访问
window.AppGlobalConfig = {
    ViewerHomeCenter: {
        y: 25.021631,
        x: 117.067706,
        z: 1204.85,
        heading: 24.9,
        pitch: -35.6,
        roll: 360,
    },
    ServerUrl: BACKGROUNG_URL,
    FRONT_URL,
    // 天地图
    TianDiTuToken: "333dabc844b45337bc6dd2873761695f",
    // 离线地图
    OfflineImageProvider: [
        {
            name: "天地图影像",
            url: FRONT_URL + "/data/tiles/fujianv2/{z}/{x}/{reverseY}.png",
            maximumLevel: 18,
        },
    ],
    CesiumTerrainProvider: FRONT_URL + "/data/terrain/fujian",
    Cesium3DTileset: FRONT_URL + "/data/3dtiles/1/tileset.json",
    CesiumIonDefaultAccessToken:
        "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiI1NjM5MjMxOS1lMWVkLTQyNDQtYTM4Yi0wZjA4ZDMxYTlmNDMiLCJpZCI6MTQ4MiwiaWF0IjoxNTI4Njc3NDQyfQ.vVoSexHMqQhKK5loNCv6gCA5d5_z3wE2M0l_rWnIP_w",
};

window.Cesium.Ion.defaultAccessToken = window.AppGlobalConfig.CesiumIonDefaultAccessToken;
